!
function(e) {
	var t = {};
	function r(n) {
		if (t[n]) return t[n].exports;
		var o = t[n] = {
			i: n,
			l: !1,
			exports: {}
		};
		return e[n].call(o.exports, o, o.exports, r),
		o.l = !0,
		o.exports
	}
	r.m = e,
	r.c = t,
	r.d = function(e, t, n) {
		r.o(e, t) || Object.defineProperty(e, t, {
			enumerable: !0,
			get: n
		})
	},
	r.r = function(e) {
		"undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(e, Symbol.toStringTag, {
			value: "Module"
		}),
		Object.defineProperty(e, "__esModule", {
			value: !0
		})
	},
	r.t = function(e, t) {
		if (1 & t && (e = r(e)), 8 & t) return e;
		if (4 & t && "object" == typeof e && e && e.__esModule) return e;
		var n = Object.create(null);
		if (r.r(n), Object.defineProperty(n, "default", {
			enumerable: !0,
			value: e
		}), 2 & t && "string" != typeof e) for (var o in e) r.d(n, o,
		function(t) {
			return e[t]
		}.bind(null, o));
		return n
	},
	r.n = function(e) {
		var t = e && e.__esModule ?
		function() {
			return e.
		default
		}:
		function() {
			return e
		};
		return r.d(t, "a", t),
		t
	},
	r.o = function(e, t) {
		return Object.prototype.hasOwnProperty.call(e, t)
	},
	r.p = ".",
	r(r.s = 13)
} ([function(e, t) {
	e.exports = function(e) {
		return e && e.__esModule ? e: {
		default:
			e
		}
	}
},
function(e, t, r) {
	"use strict";
	var n = r(0)(r(0));
	Object.defineProperty(t, "__esModule", {
		value: !0
	}),
	t.decipher = t.cipher = t.fetch_retry = t.fetchWithTimeout = void 0;
	var o = r(2),
	a = (0, n.
default)(o);
	function i(e, t) {
		var r = Object.keys(e);
		if (Object.getOwnPropertySymbols) {
			var n = Object.getOwnPropertySymbols(e);
			t && (n = n.filter((function(t) {
				return Object.getOwnPropertyDescriptor(e, t).enumerable
			}))),
			r.push.apply(r, n)
		}
		return r
	}
	function s(e) {
		for (var t = 1; t < arguments.length; t++) {
			var r = null != arguments[t] ? arguments[t] : {};
			t % 2 ? i(Object(r), !0).forEach((function(t) { (0, a.
			default)(e, t, r[t])
			})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : i(Object(r)).forEach((function(t) {
				Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(r, t))
			}))
		}
		return e
	}
	t.setStoreWithExpiry = c,
	t.getStoreWithExpiry = l,
	t.plusDlCount = function() {
		var e = l("dailyDlCount");
		e = e ? parseInt(e) + 1 : 1;
		var t = 60 * (r = (new Date).getHours(), n = (new Date).getMinutes(), 1440 - 60 * r - n) * 1e3;
		var r, n;
		c("dailyDlCount", e, t)
	};
	var u = t.fetchWithTimeout = function(e) {
		var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {},
		r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 5e3,
		n = new AbortController,
		o = s({},
		t, {
			signal: n.signal
		});
		setTimeout((function() {
			n.abort()
		}), r);
		return fetch(e, o).then((function(e) {
			if (!e.ok) throw new Error("".concat(e.status, ": ").concat(e.statusText));
			return e
		})).
		catch((function(e) {
			if ("AbortError" === e.name) throw new Error("Response timed out");
			throw new Error(e.message)
		}))
	};
	t.fetch_retry = function e(t, r, n) {
		var o = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : 1;
		return u(t, r, n).
		catch((function(a) {
			if (1 === o) throw a;
			return e(t, r, n, o - 1)
		}))
	},
	t.cipher = function(e) {
		var t = function(e) {
			return e.split("").map((function(e) {
				return e.charCodeAt(0)
			}))
		},
		r = function(e) {
			return ("0" + Number(e).toString(16)).substr( - 2)
		},
		n = function(r) {
			return t(e).reduce((function(e, t) {
				return e ^ t
			}), r)
		};
		return function(e) {
			return e.split("").map(t).map(n).map(r).join("")
		}
	},
	t.decipher = function(e) {
		var t = function(t) {
			return (r = e, r.split("").map((function(e) {
				return e.charCodeAt(0)
			}))).reduce((function(e, t) {
				return e ^ t
			}), t);
			var r
		};
		return function(e) {
			return e.match(/.{1,2}/g).map((function(e) {
				return parseInt(e, 16)
			})).map(t).map((function(e) {
				return String.fromCharCode(e)
			})).join("")
		}
	};
	function c(e, t, r) {
		var n = {
			value: t,
			expiry: (new Date).getTime() + r
		};
		localStorage.setItem(e, JSON.stringify(n))
	}
	function l(e) {
		var t = localStorage.getItem(e);
		if (!t) return null;
		var r = JSON.parse(t);
		return (new Date).getTime() > r.expiry ? (localStorage.removeItem(e), null) : r.value
	}
},
function(e, t) {
	e.exports = function(e, t, r) {
		return t in e ? Object.defineProperty(e, t, {
			value: r,
			enumerable: !0,
			configurable: !0,
			writable: !0
		}) : e[t] = r,
		e
	}
},
function(e, t, r) {
	"use strict";
	Object.defineProperty(t, "__esModule", {
		value: !0
	}),
	t.DISABLE_DOWNLOADING_FROM_YOUTUBE_REGEXP = t.supportedLanguages = t.t = t.PRE_DEF_EXTS = t.YTDLPAGE = t.HOMEPAGE = t.ISEDGE = t.PROENV = void 0,
	t.doInit = function() {
		if (void 0 === localStorage[i] || "" == localStorage[i]) {
			var e = new Array({
				ext: "flv",
				size: 10
			},
			{
				ext: "hlv",
				size: 10
			},
			{
				ext: "f4v",
				size: 10
			},
			{
				ext: "mp4",
				size: 10
			},
			{
				ext: "mp3",
				size: 10
			},
			{
				ext: "wma",
				size: 10
			},
			{
				ext: "wav",
				size: 10
			},
			{
				ext: "m4a",
				size: 10
			},
			{
				ext: "webm",
				size: 10
			},
			{
				ext: "ogg",
				size: 10
			},
			{
				ext: "ogv",
				size: 10
			},
			{
				ext: "acc",
				size: 10
			},
			{
				ext: "mov",
				size: 10
			},
			{
				ext: "mkv",
				size: 10
			},
			{
				ext: "m3u8",
				size: 0
			},
			{
				ext: "ts",
				size: 1e11
			});
			localStorage[i] = JSON.stringify(e)
		}
		if (void 0 === localStorage.Type) {
			var t = new Array({
				Type: "video/*",
				size: 2048
			},
			{
				Type: "audio/*",
				size: 10
			});
			localStorage.Type = JSON.stringify(t)
		}
		if (void 0 === localStorage.BlockedDomains) {
			var r = new Array;
			localStorage.BlockedDomains = JSON.stringify(r)
		}
		void 0 === localStorage.repeat && (localStorage.repeat = !1);
		void 0 === localStorage.repeatReg && (localStorage.repeatReg = "\\?[\\S]+");
		void 0 === localStorage.Debug && (localStorage.Debug = !1);
		void 0 === localStorage.TitleName && (localStorage.TitleName = !1);
		void 0 === localStorage.popListCount && (localStorage.popListCount = 30);
		void 0 === localStorage.showCountOnIcon && (localStorage.showCountOnIcon = !0)
	},
	t.tr = function(e) {
		$("#" + e).html(s(e))
	},
	t.getLanguage = c,
	t.getExtManifest = function() {
		return o.runtime.getManifest()
	},
	t.isActivePro = d,
	t.getLoaderUrl = function() {
		var e, t = c(),
		r = "://cococut.net/";
		e = "other" != t ? "hls.html": "ohls.html";
		var o, i = function() {
			var e = p();
			e.dailycount || (e.dailycount = 50);
			var t = (0, n.getStoreWithExpiry)("dailyDlCount");
			if (t && t > e.dailycount) {
				return "exceeded.html"
			}
		} ();
		i && (e = i);
		d() && (r = "://pro.cococut.net/", e = "hls.vhtml", "other" == t && (e = "ohls.vhtml"));
		o = a ? r + (u.includes(t) ? t + "/": "") + e: "://127.0.0.1/" + e;
		return o
	},
	t.getDLMUrl = function() {
		var e, t, r = c(),
		n = "://cococut.net/";
		e = "other" != r ? "dlm.html": "odlm.html";
		d() && (n = "://pro.cococut.net/", e = "dlm.vhtml", "other" == r && (e = "odlm.vhtml"));
		t = a ? n + "dlm/" + (u.includes(r) ? r + "/": "") + e: "://127.0.0.1/dlm/" + e;
		return t
	};
	var n = r(1),
	o = navigator.userAgent.includes("Chrome") ? chrome: browser,
	a = t.PROENV = !0;
	t.ISEDGE = !1,
	t.HOMEPAGE = void 0,
	t.YTDLPAGE = void 0;
	a ? (t.HOMEPAGE = "https://cococut.net", t.YTDLPAGE = "https://pro.cococut.net/yt/") : (console.log("dev env"), t.HOMEPAGE = "http://127.0.0.1", t.YTDLPAGE = "http://127.0.0.1");
	var i = t.PRE_DEF_EXTS = "Ext04";
	o.browserAction.setIcon({
		path: {
			16 : "assets/icons/16x16_gray.png",
			32 : "assets/icons/32x32_gray.png",
			48 : "assets/icons/48x48_gray.png",
			64 : "assets/icons/64x64_gray.png",
			128 : "assets/icons/128x128_gray.png"
		}
	});
	var s = t.t = o.i18n.getMessage;
	var u = t.supportedLanguages = ["zh_tw", "zh_cn"];
	function c() {
		var e = o.i18n.getUILanguage();
		return e.match(/zh-CN/) ? "zh_cn": e.match(/zh-TW/) ? "zh_tw": e.startsWith("zh") ? "zh_cn": e.startsWith("en") ? e.substr(0, 2) : "other"
	}
	if (o.runtime.onInstalled.addListener((function(e) {
		var t = c(),
		r = "https://cococut.net/" + (u.includes(t) ? t + "/": "") + "installed.html";
		localStorage.getItem("installed") || o.tabs.create({
			url: r
		},
		(function(e) {
			console.log("Hi, wellcome:)"),
			localStorage.setItem("installed", "t")
		}))
	})), o.runtime.setUninstallURL) {
		var l = c(),
		f = "https://cococut.net/" + (u.includes(l) ? l + "/": "") + "uninstalled.html";
		o.runtime.setUninstallURL(f)
	}
	t.DISABLE_DOWNLOADING_FROM_YOUTUBE_REGEXP = /^https?:\/\/www\.youtube\.com\//;
	function d() {
		if (localStorage.getItem("pui") && "active" == (0, n.decipher)("CocoCut pro user")(localStorage.getItem("pui")).split("||")[3]) return ! 0;
		return ! 1
	}
	var p = function() {
		var e = localStorage.option,
		t = {
			counter: 0,
			domain: {}
		};
		try {
			e && Object.assign(t, JSON.parse(e)),
			t.counter = Math.max(0, Math.floor(Number(t.counter) || 0)),
			t.rcounterr = Math.max(0, Math.floor(Number(t.rcounterr) || 0)),
			localStorage.option = JSON.stringify(t)
		} catch(e) {
			console.log(e.stack)
		}
		return t
	}
},
function(e, t, r) {
	e.exports = r(6)
},
function(e, t) {
	function r(e, t, r, n, o, a, i) {
		try {
			var s = e[a](i),
			u = s.value
		} catch(e) {
			return void r(e)
		}
		s.done ? t(u) : Promise.resolve(u).then(n, o)
	}
	e.exports = function(e) {
		return function() {
			var t = this,
			n = arguments;
			return new Promise((function(o, a) {
				var i = e.apply(t, n);
				function s(e) {
					r(i, o, a, s, u, "next", e)
				}
				function u(e) {
					r(i, o, a, s, u, "throw", e)
				}
				s(void 0)
			}))
		}
	}
},
function(e, t, r) {
	var n = function(e) {
		"use strict";
		var t, r = Object.prototype,
		n = r.hasOwnProperty,
		o = "function" == typeof Symbol ? Symbol: {},
		a = o.iterator || "@@iterator",
		i = o.asyncIterator || "@@asyncIterator",
		s = o.toStringTag || "@@toStringTag";
		function u(e, t, r, n) {
			var o = t && t.prototype instanceof v ? t: v,
			a = Object.create(o.prototype),
			i = new I(n || []);
			return a._invoke = function(e, t, r) {
				var n = l;
				return function(o, a) {
					if (n === d) throw new Error("Generator is already running");
					if (n === p) {
						if ("throw" === o) throw a;
						return N()
					}
					for (r.method = o, r.arg = a;;) {
						var i = r.delegate;
						if (i) {
							var s = _(i, r);
							if (s) {
								if (s === h) continue;
								return s
							}
						}
						if ("next" === r.method) r.sent = r._sent = r.arg;
						else if ("throw" === r.method) {
							if (n === l) throw n = p,
							r.arg;
							r.dispatchException(r.arg)
						} else "return" === r.method && r.abrupt("return", r.arg);
						n = d;
						var u = c(e, t, r);
						if ("normal" === u.type) {
							if (n = r.done ? p: f, u.arg === h) continue;
							return {
								value: u.arg,
								done: r.done
							}
						}
						"throw" === u.type && (n = p, r.method = "throw", r.arg = u.arg)
					}
				}
			} (e, r, i),
			a
		}
		function c(e, t, r) {
			try {
				return {
					type: "normal",
					arg: e.call(t, r)
				}
			} catch(e) {
				return {
					type: "throw",
					arg: e
				}
			}
		}
		e.wrap = u;
		var l = "suspendedStart",
		f = "suspendedYield",
		d = "executing",
		p = "completed",
		h = {};
		function v() {}
		function g() {}
		function m() {}
		var y = {};
		y[a] = function() {
			return this
		};
		var b = Object.getPrototypeOf,
		E = b && b(b(A([])));
		E && E !== r && n.call(E, a) && (y = E);
		var S = m.prototype = v.prototype = Object.create(y);
		function w(e) { ["next", "throw", "return"].forEach((function(t) {
				e[t] = function(e) {
					return this._invoke(t, e)
				}
			}))
		}
		function T(e) {
			var t;
			this._invoke = function(r, o) {
				function a() {
					return new Promise((function(t, a) { !
						function t(r, o, a, i) {
							var s = c(e[r], e, o);
							if ("throw" !== s.type) {
								var u = s.arg,
								l = u.value;
								return l && "object" == typeof l && n.call(l, "__await") ? Promise.resolve(l.__await).then((function(e) {
									t("next", e, a, i)
								}), (function(e) {
									t("throw", e, a, i)
								})) : Promise.resolve(l).then((function(e) {
									u.value = e,
									a(u)
								}), (function(e) {
									return t("throw", e, a, i)
								}))
							}
							i(s.arg)
						} (r, o, t, a)
					}))
				}
				return t = t ? t.then(a, a) : a()
			}
		}
		function _(e, r) {
			var n = e.iterator[r.method];
			if (n === t) {
				if (r.delegate = null, "throw" === r.method) {
					if (e.iterator.
					return && (r.method = "return", r.arg = t, _(e, r), "throw" === r.method)) return h;
					r.method = "throw",
					r.arg = new TypeError("The iterator does not provide a 'throw' method")
				}
				return h
			}
			var o = c(n, e.iterator, r.arg);
			if ("throw" === o.type) return r.method = "throw",
			r.arg = o.arg,
			r.delegate = null,
			h;
			var a = o.arg;
			return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, h) : a: (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, h)
		}
		function x(e) {
			var t = {
				tryLoc: e[0]
			};
			1 in e && (t.catchLoc = e[1]),
			2 in e && (t.finallyLoc = e[2], t.afterLoc = e[3]),
			this.tryEntries.push(t)
		}
		function O(e) {
			var t = e.completion || {};
			t.type = "normal",
			delete t.arg,
			e.completion = t
		}
		function I(e) {
			this.tryEntries = [{
				tryLoc: "root"
			}],
			e.forEach(x, this),
			this.reset(!0)
		}
		function A(e) {
			if (e) {
				var r = e[a];
				if (r) return r.call(e);
				if ("function" == typeof e.next) return e;
				if (!isNaN(e.length)) {
					var o = -1,
					i = function r() {
						for (; ++o < e.length;) if (n.call(e, o)) return r.value = e[o],
						r.done = !1,
						r;
						return r.value = t,
						r.done = !0,
						r
					};
					return i.next = i
				}
			}
			return {
				next: N
			}
		}
		function N() {
			return {
				value: t,
				done: !0
			}
		}
		return g.prototype = S.constructor = m,
		m.constructor = g,
		m[s] = g.displayName = "GeneratorFunction",
		e.isGeneratorFunction = function(e) {
			var t = "function" == typeof e && e.constructor;
			return !! t && (t === g || "GeneratorFunction" === (t.displayName || t.name))
		},
		e.mark = function(e) {
			return Object.setPrototypeOf ? Object.setPrototypeOf(e, m) : (e.__proto__ = m, s in e || (e[s] = "GeneratorFunction")),
			e.prototype = Object.create(S),
			e
		},
		e.awrap = function(e) {
			return {
				__await: e
			}
		},
		w(T.prototype),
		T.prototype[i] = function() {
			return this
		},
		e.AsyncIterator = T,
		e.async = function(t, r, n, o) {
			var a = new T(u(t, r, n, o));
			return e.isGeneratorFunction(r) ? a: a.next().then((function(e) {
				return e.done ? e.value: a.next()
			}))
		},
		w(S),
		S[s] = "Generator",
		S[a] = function() {
			return this
		},
		S.toString = function() {
			return "[object Generator]"
		},
		e.keys = function(e) {
			var t = [];
			for (var r in e) t.push(r);
			return t.reverse(),
			function r() {
				for (; t.length;) {
					var n = t.pop();
					if (n in e) return r.value = n,
					r.done = !1,
					r
				}
				return r.done = !0,
				r
			}
		},
		e.values = A,
		I.prototype = {
			constructor: I,
			reset: function(e) {
				if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(O), !e) for (var r in this)"t" === r.charAt(0) && n.call(this, r) && !isNaN( + r.slice(1)) && (this[r] = t)
			},
			stop: function() {
				this.done = !0;
				var e = this.tryEntries[0].completion;
				if ("throw" === e.type) throw e.arg;
				return this.rval
			},
			dispatchException: function(e) {
				if (this.done) throw e;
				var r = this;
				function o(n, o) {
					return s.type = "throw",
					s.arg = e,
					r.next = n,
					o && (r.method = "next", r.arg = t),
					!!o
				}
				for (var a = this.tryEntries.length - 1; a >= 0; --a) {
					var i = this.tryEntries[a],
					s = i.completion;
					if ("root" === i.tryLoc) return o("end");
					if (i.tryLoc <= this.prev) {
						var u = n.call(i, "catchLoc"),
						c = n.call(i, "finallyLoc");
						if (u && c) {
							if (this.prev < i.catchLoc) return o(i.catchLoc, !0);
							if (this.prev < i.finallyLoc) return o(i.finallyLoc)
						} else if (u) {
							if (this.prev < i.catchLoc) return o(i.catchLoc, !0)
						} else {
							if (!c) throw new Error("try statement without catch or finally");
							if (this.prev < i.finallyLoc) return o(i.finallyLoc)
						}
					}
				}
			},
			abrupt: function(e, t) {
				for (var r = this.tryEntries.length - 1; r >= 0; --r) {
					var o = this.tryEntries[r];
					if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) {
						var a = o;
						break
					}
				}
				a && ("break" === e || "continue" === e) && a.tryLoc <= t && t <= a.finallyLoc && (a = null);
				var i = a ? a.completion: {};
				return i.type = e,
				i.arg = t,
				a ? (this.method = "next", this.next = a.finallyLoc, h) : this.complete(i)
			},
			complete: function(e, t) {
				if ("throw" === e.type) throw e.arg;
				return "break" === e.type || "continue" === e.type ? this.next = e.arg: "return" === e.type ? (this.rval = this.arg = e.arg, this.method = "return", this.next = "end") : "normal" === e.type && t && (this.next = t),
				h
			},
			finish: function(e) {
				for (var t = this.tryEntries.length - 1; t >= 0; --t) {
					var r = this.tryEntries[t];
					if (r.finallyLoc === e) return this.complete(r.completion, r.afterLoc),
					O(r),
					h
				}
			},
			catch: function(e) {
				for (var t = this.tryEntries.length - 1; t >= 0; --t) {
					var r = this.tryEntries[t];
					if (r.tryLoc === e) {
						var n = r.completion;
						if ("throw" === n.type) {
							var o = n.arg;
							O(r)
						}
						return o
					}
				}
				throw new Error("illegal catch attempt")
			},
			delegateYield: function(e, r, n) {
				return this.delegate = {
					iterator: A(e),
					resultName: r,
					nextLoc: n
				},
				"next" === this.method && (this.arg = t),
				h
			}
		},
		e
	} (e.exports);
	try {
		regeneratorRuntime = n
	} catch(e) {
		Function("r", "regeneratorRuntime = r")(n)
	}
},
function(e, t, r) {
	"use strict";
	var n = r(0)(r(0));
	Object.defineProperty(t, "__esModule", {
		value: !0
	}),
	t.setBgOptions = t.getBgOptions = t.tellBGbroadcastMsgFromPipe = t.setUserInfo = t.keepSetHeader = t.unsetHeader = t.setHeader = t.fetchTheDom = t.EVENTS = void 0;
	var o, a, i, s, u, c, l, f, d = r(4),
	p = (0, n.
default)(d),
	h = r(5),
	v = (0, n.
default)(h);
	t.fetchTheDom = (o = (0, v.
default)(p.
default.mark((function e(t) {
		var r;
		return p.
	default.wrap((function(e) {
			for (;;) switch (e.prev = e.next) {
			case 0:
				return e.next = 2,
				y(m.FETCH_DOM, t);
			case 2:
				return r = e.sent,
				e.abrupt("return", r);
			case 4:
			case "end":
				return e.stop()
			}
		}), e)
	}))),
	function(e) {
		return o.apply(this, arguments)
	}),
	t.setHeader = (a = (0, v.
default)(p.
default.mark((function e(t) {
		var r;
		return p.
	default.wrap((function(e) {
			for (;;) switch (e.prev = e.next) {
			case 0:
				return e.next = 2,
				y(m.SET_HEADER, t);
			case 2:
				return r = e.sent,
				e.abrupt("return", r);
			case 4:
			case "end":
				return e.stop()
			}
		}), e)
	}))),
	function(e) {
		return a.apply(this, arguments)
	}),
	t.unsetHeader = (i = (0, v.
default)(p.
default.mark((function e(t) {
		var r;
		return p.
	default.wrap((function(e) {
			for (;;) switch (e.prev = e.next) {
			case 0:
				return e.next = 2,
				y(m.UNSET_HEADER, t);
			case 2:
				return r = e.sent,
				e.abrupt("return", r);
			case 4:
			case "end":
				return e.stop()
			}
		}), e)
	}))),
	function(e) {
		return i.apply(this, arguments)
	}),
	t.keepSetHeader = (s = (0, v.
default)(p.
default.mark((function e(t) {
		var r;
		return p.
	default.wrap((function(e) {
			for (;;) switch (e.prev = e.next) {
			case 0:
				return e.next = 2,
				y(m.KEEP_SET_HEADER, t);
			case 2:
				return r = e.sent,
				e.abrupt("return", r);
			case 4:
			case "end":
				return e.stop()
			}
		}), e)
	}))),
	function(e) {
		return s.apply(this, arguments)
	}),
	t.setUserInfo = (u = (0, v.
default)(p.
default.mark((function e(t) {
		var r;
		return p.
	default.wrap((function(e) {
			for (;;) switch (e.prev = e.next) {
			case 0:
				return e.next = 2,
				y(m.SET_USER_INFO, t);
			case 2:
				return r = e.sent,
				e.abrupt("return", r);
			case 4:
			case "end":
				return e.stop()
			}
		}), e)
	}))),
	function(e) {
		return u.apply(this, arguments)
	}),
	t.tellBGbroadcastMsgFromPipe = (c = (0, v.
default)(p.
default.mark((function e(t) {
		return p.
	default.wrap((function(e) {
			for (;;) switch (e.prev = e.next) {
			case 0:
				y(m.MESSAGEPIPE, t);
			case 1:
			case "end":
				return e.stop()
			}
		}), e)
	}))),
	function(e) {
		return c.apply(this, arguments)
	}),
	t.getBgOptions = (l = (0, v.
default)(p.
default.mark((function e() {
		var t;
		return p.
	default.wrap((function(e) {
			for (;;) switch (e.prev = e.next) {
			case 0:
				return e.next = 2,
				y(m.GET_BG_OPTIONS);
			case 2:
				return t = e.sent,
				e.abrupt("return", t);
			case 4:
			case "end":
				return e.stop()
			}
		}), e)
	}))),
	function() {
		return l.apply(this, arguments)
	}),
	t.setBgOptions = (f = (0, v.
default)(p.
default.mark((function e(t) {
		return p.
	default.wrap((function(e) {
			for (;;) switch (e.prev = e.next) {
			case 0:
				y(m.SET_BG_OPTIONS, t);
			case 1:
			case "end":
				return e.stop()
			}
		}), e)
	}))),
	function(e) {
		return f.apply(this, arguments)
	});
	t.onMessage = function(e, t) {
		g.runtime.onMessage.addListener((function(r, n, o) {
			var a = r.eventName,
			i = r.data;
			return a === e && (t(i, o), !0)
		}))
	},
	t.sendMessage = y;
	var g = navigator.userAgent.includes("Chrome") ? chrome: browser,
	m = t.EVENTS = {
		FETCH_DOM: "FETCH_DOM",
		SET_HEADER: "ADD_HEADER",
		UNSET_HEADER: "UNSET_HEADER",
		KEEP_SET_HEADER: "KEEP_SET_HEADER",
		BLOCK_ONE_DOMAIN: "BLOCK_ONE_DOMAIN",
		SET_SPEEDUP_REC: "SET_SPEEDUP_REC",
		SET_USER_INFO: "SET_USER_INFO",
		DLM_NEW_TASK: "DLM_NEW_TASK",
		ISAP: "IS_ACTIVE_MEMBER",
		MESSAGEPIPE: "MESSAGEPIPE",
		BROADCASTPIPEMESSAGE: "BROADCASTPIPEMESSAGE",
		GET_BG_OPTIONS: "GET_BG_OPTIONS",
		SET_BG_OPTIONS: "SET_BG_OPTIONS"
	};
	function y(e, t) {
		return new Promise((function(r) {
			g.runtime.sendMessage({
				eventName: e,
				data: t
			},
			(function(e) {
				r(e)
			}))
		}))
	}
},
,
function(e, t, r) {
	var n = r(14),
	o = r(15),
	a = r(16);
	e.exports = function(e) {
		return n(e) || o(e) || a()
	}
},
, , ,
function(e, t, r) {
	"use strict";
	var n, o, a, i, s, u, c, l = r(0)(r(0)),
	f = r(9),
	d = (0, l.
default)(f),
	p = r(4),
	h = (0, l.
default)(p),
	v = r(5),
	g = (0, l.
default)(v),
	m = r(17),
	y = (0, l.
default)(m),
	b = (n = (0, g.
default)(h.
default.mark((function e(t) {
		var r, n, o, a, i, s, u, c;
		return h.
	default.wrap((function(e) {
			for (;;) switch (e.prev = e.next) {
			case 0:
				return r = t.url,
				n = t.domLabel,
				o = t.reqInit,
				a = t.fetchTimeout,
				i = t.retryCount,
				e.next = 3,
				(0, N.fetch_retry)(r, o, a, i).then((function(e) {
					if (e.ok) return e.text();
					throw new Error(e.statusText)
				})).then((function(e) {
					if (u = e, n) {
						var t = (new DOMParser).parseFromString(e, "text/html");
						s = t.querySelector(n),
						c = {}
					}
				})).
				catch((function(e) {
					return console.log("failed fetch page: ", r, e),
					c = {
						url: r,
						err: e.toString()
					},
					!1
				}));
			case 3:
				if (c) {
					e.next = 7;
					break
				}
				return e.abrupt("return", {
					dom: s,
					originHtml: u
				});
			case 7:
				return e.abrupt("return", c);
			case 8:
			case "end":
				return e.stop()
			}
		}), e)
	}))),
	function(e) {
		return n.apply(this, arguments)
	}),
	E = (o = (0, g.
default)(h.
default.mark((function e(t) {
		var r, n, o;
		return h.
	default.wrap((function(e) {
			for (;;) switch (e.prev = e.next) {
			case 0:
				return e.next = 2,
				b(t);
			case 2:
				if (! (r = e.sent).hasOwnProperty("err")) {
					e.next = 5;
					break
				}
				return e.abrupt("return", r);
			case 5:
				if (n = r.dom, o = r.originHtml, !t.domLabel) {
					e.next = 11;
					break
				}
				if (!n) {
					e.next = 9;
					break
				}
				return e.abrupt("return", n.innerHTML);
			case 9:
				e.next = 13;
				break;
			case 11:
				if (!o) {
					e.next = 13;
					break
				}
				return e.abrupt("return", o);
			case 13:
			case "end":
				return e.stop()
			}
		}), e)
	}))),
	function(e) {
		return o.apply(this, arguments)
	}),
	S = (a = (0, g.
default)(h.
default.mark((function e(t, r) {
		var n, o, a, i, s, u, c;
		return h.
	default.wrap((function(e) {
			for (;;) switch (e.prev = e.next) {
			case 0:
				for (n = t.oneHeadDomain, o = t.oneHeadValue, q.push(n), a = 0, i = Object.entries(o); a < i.length; a++) s = (0, y.
			default)(i[a], 2),
				u = s[0],
				c = s[1],
				z[u] = c;
				W(),
				t.keepTime && (j = window.setTimeout(J, t.keepTime));
			case 5:
			case "end":
				return e.stop()
			}
		}), e)
	}))),
	function(e, t) {
		return a.apply(this, arguments)
	}),
	w = (i = (0, g.
default)(h.
default.mark((function e(t, r) {
		var n;
		return h.
	default.wrap((function(e) {
			for (;;) switch (e.prev = e.next) {
			case 0:
				return e.next = 2,
				E(t);
			case 2:
				n = e.sent,
				r({
					type: "repDom",
					theFetchResp: n
				});
			case 5:
			case "end":
				return e.stop()
			}
		}), e)
	}))),
	function(e, t) {
		return i.apply(this, arguments)
	}),
	T = (s = (0, g.
default)(h.
default.mark((function e(t) {
		var r, n, o, a, i;
		return h.
	default.wrap((function(e) {
			for (;;) switch (e.prev = e.next) {
			case 0:
				r = t.oneDomain,
				n = t.tabId,
				o = t.mediaId,
				a = t.oneEleIndex,
				delete D[o][a],
				C(n),
				(i = JSON.parse(localStorage.BlockedDomains)).push(r),
				i = (0, d.
			default)(new Set(i)),
				localStorage.BlockedDomains = JSON.stringify(i);
			case 7:
			case "end":
				return e.stop()
			}
		}), e)
	}))),
	function(e) {
		return s.apply(this, arguments)
	}),
	_ = (u = (0, g.
default)(h.
default.mark((function e(t) {
		var r, n;
		return h.
	default.wrap((function(e) {
			for (;;) switch (e.prev = e.next) {
			case 0:
				r = t.tabId,
				t.checked ? (n = "if(!window.changeTime){videoTimeHook_(window)}else{console.log('videoTimeHook_ inited')};", P.tabs.executeScript(r, {
					code: n,
					allFrames: !0,
					runAt: "document_idle"
				},
				V("tabs.executeScript.on.setSpeedUpRecDiv")), n = "changeTime(2, 0, true);", P.tabs.executeScript(r, {
					code: n,
					allFrames: !0,
					runAt: "document_idle"
				},
				V("tabs.executeScript.on.setSpeedUpRecDiv"))) : P.tabs.executeScript(r, {
					code: "changeTime(0, 0, false, true);",
					allFrames: !0,
					runAt: "document_idle"
				},
				V("tabs.executeScript.on.setSpeedUpRecDiv"));
			case 2:
			case "end":
				return e.stop()
			}
		}), e)
	}))),
	function(e) {
		return u.apply(this, arguments)
	}),
	x = (c = (0, g.
default)(h.
default.mark((function e(t) {
		return h.
	default.wrap((function(e) {
			for (;;) switch (e.prev = e.next) {
			case 0:
				t ? localStorage.setItem("pui", t) : localStorage.removeItem("pui");
			case 1:
			case "end":
				return e.stop()
			}
		}), e)
	}))),
	function(e) {
		return c.apply(this, arguments)
	}),
	O = r(3),
	I = r(21),
	A = r(7),
	N = r(1); (0, O.doInit)();
	var D = D || new Array;
	window.mediaurls = D;
	var L = new Array,
	P = navigator.userAgent.includes("Chrome") ? chrome: browser; (0, I.doHlsParsefunction)();
	var M = ["$", "^", "[", "]", "(", ")", "{", "}", "|", "+", ".", "\\"];
	function R(e, t) {
		for (var r = "^",
		n = 0; n < e.length; n++) {
			var o = e.charAt(n);
			if (k(o)) r += "\\" + o;
			else switch (o) {
			case "*":
				r += ".*";
				break;
			case "?":
				r += ".{0,1}";
				break;
			default:
				r += o
			}
		}
		return r += "$",
		null != t.match(r)
	}
	function k(e) {
		for (var t in M) if (e == t) return ! 0;
		return ! 1
	}
	function C(e) {
		console.log("updateBadgetAndIcon");
		var t = D["tabid" + e].reduce((function(e) {
			return e + 1
		}), 0);
		t > 0 ? (P.browserAction.setIcon({
			path: {
				16 : "assets/icons/16x16.png",
				32 : "assets/icons/32x32.png",
				48 : "assets/icons/48x48.png",
				64 : "assets/icons/64x64.png",
				128 : "assets/icons/128x128.png"
			},
			tabId: e
		}), "true" == localStorage.showCountOnIcon && P.browserAction.setBadgeText({
			text: t.toString(),
			tabId: e
		}), P.browserAction.setTitle({
			title: (0, O.t)("TbadgetTitle", [t]),
			tabId: e
		})) : (P.browserAction.setIcon({
			path: {
				16 : "assets/icons/16x16_gray.png",
				32 : "assets/icons/32x32_gray.png",
				48 : "assets/icons/48x48_gray.png",
				64 : "assets/icons/64x64_gray.png",
				128 : "assets/icons/128x128_gray.png"
			}
		}), P.browserAction.setBadgeText({
			text: "",
			tabId: e
		}), P.browserAction.setTitle({
			title: "CocoCut",
			tabId: e
		}))
	}
	function U(e) {
		var t = e.split("?");
		return (t = (t = t[0].split("/"))[t.length - 1].split("#"))[0].toLowerCase()
	}
	function H(e) {
		var t = e.split(".");
		if (1 == t.length) return null;
		var r = t[t.length - 1];
		return (r = r.match(/[0-9a-zA-Z]*/))[0].toLowerCase()
	}
	function B(e, t) {
		e = e.toLowerCase();
		for (var r = 0; r < t.responseHeaders.length; r++) if (t.responseHeaders[r].name.toLowerCase() == e) return t.responseHeaders[r].value.toLowerCase();
		return null
	}
	function G(e, t, r) {
		e = e.toLowerCase();
		for (var n = 0; n < r.responseHeaders.length; n++) r.responseHeaders[n].name.toLowerCase() == e && (r.responseHeaders[n].value = t)
	}
	P.webRequest.onResponseStarted.addListener((function(e) { !
		function(e) {
			if ( - 1 == e.tabId) return;
			if (!I.tabs[e.tabId]) return;
			if ( - 1 !== I.tabs[e.tabId].url.indexOf("cococut.net")) return;
			if (O.DISABLE_DOWNLOADING_FROM_YOUTUBE_REGEXP.exec(I.tabs[e.tabId].url)) return void(I.tabs[e.tabId].url.indexOf("/watch") > -1 && (0, O.isActivePro)() && (P.browserAction.setIcon({
				path: {
					16 : "assets/icons/16x16.png",
					32 : "assets/icons/32x32.png",
					48 : "assets/icons/48x48.png",
					64 : "assets/icons/64x64.png",
					128 : "assets/icons/128x128.png"
				},
				tabId: e.tabId
			}), P.browserAction.setBadgeText({
				text: "1",
				tabId: e.tabId
			})));
			if (t = "tabid" + e.tabId, (D[t] ? D[t].length: 0) >= Number(localStorage.popListCount)) return;
			var t;
			var r = B("content-length", e),
			n = U(e.url),
			o = H(n),
			a = B("content-type", e);
			"true" == localStorage.Debug && console.log({
				name: n,
				url: e.url,
				size: r,
				ext: o,
				type: a,
				tabid: e.tabId,
				all: e
			});
			var i = new URL(e.url),
			s = JSON.parse(localStorage.BlockedDomains);
			for (l = 0; l < s.length; l++) {
				var u = s[l].toLowerCase();
				if (i.host == u) return
			}
			L = JSON.parse(localStorage[O.PRE_DEF_EXTS]);
			for (var c = !1,
			l = 0; l < L.length; l++) {
				if ( - 1 != L[l].ext.toLowerCase().indexOf(o)) {
					if (0 == L[l].size || r >= 1024 * L[l].size || null == r) {
						c = !0,
						"ts" == o && null == r && (c = !1);
						break
					}
					return
				}
			}
			if (null != a && !c) {
				var f = JSON.parse(localStorage.Type);
				for (l = 0; l < f.length; l++) {
					if (R(f[l].Type.toLowerCase(), a)) {
						if (0 == f[l].size || r >= 1024 * f[l].size || null == r) {
							c = !0;
							break
						}
						return
					}
				}
			}
			var d = B("Content-Disposition", e);
			if (d) {
				var p = d.match(/filename="(.*?)"/);
				if (p && p[1]) {
					n = U(n = decodeURIComponent(p[1])),
					o = H(n);
					for (l = 0; l < L.length; l++) {
						if ( - 1 != L[l].ext.toLowerCase().indexOf(o)) {
							c = !0;
							break
						}
					}
				}
			}
			if (c) {
				var h = e.url,
				v = h,
				g = "tabid" + e.tabId,
				m = new RegExp(localStorage.repeatReg, "g");
				"true" == localStorage.repeat && (v = v.replace(m, "")),
				null == D[g] && (D[g] = []);
				for (var y = 0; y < D[g].length; y++) {
					var b = D[g][y].url;
					if ("true" == localStorage.repeat && (b = b.replace(m, "")), b == v) return
				}
				P.tabs.get(e.tabId, (function(t) {
					if (P.runtime.lastError) {
						var i = P.runtime.lastError.message;
						console.info(i)
					}
					var s;
					t && (s = t.title),
					function() {
						var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : "*******";
						r = Math.round(100 * r / 1024 / 1024) / 100 + "MB";
						var i = {
							name: n,
							url: h,
							size: r,
							ext: o,
							type: a,
							tabid: e.tabId,
							title: t,
							mediaid: g
						};
						D[g].push(i),
						P.runtime.sendMessage(i),
						C(e.tabId)
					} (s)
				}))
			}
		} (e)
	}), {
		urls: ["http://*/*", "https://*/*"]
	},
	["responseHeaders"]),
	P.tabs.onUpdated.addListener((function(e, t) {
		if ("loading" == t.status) {
			var r = "tabid" + e;
			D[r] && (D[r] = [])
		}
	})),
	P.tabs.onRemoved.addListener((function(e) {
		var t = "tabid" + e;
		D[t] && delete D[t]
	}));
	var j, q = [],
	z = {};
	function F(e) {
		var t = !0,
		r = !1,
		n = void 0;
		try {
			for (var o, a = q[Symbol.iterator](); ! (t = (o = a.next()).done); t = !0) {
				var i = o.value;
				if ( - 1 != e.url.indexOf(i)) {
					for (var s = 0,
					u = Object.entries(z); s < u.length; s++) {
						var c = (0, y.
					default)(u[s], 2),
						l = c[0],
						f = c[1]; - 1 !== l.indexOf("SetItse2-") ? G(l = l.split("SetItse2-")[1], f, e) : e.responseHeaders.push({
							name: l,
							value: f
						})
					}
					return {
						responseHeaders: e.responseHeaders
					}
				}
			}
		} catch(e) {
			r = !0,
			n = e
		} finally {
			try {
				t || null == a.
				return || a.
				return ()
			} finally {
				if (r) throw n
			}
		}
	}
	function W() {
		q && z && P.webRequest.onHeadersReceived.addListener(F, {
			urls: ["<all_urls>"]
		},
		["responseHeaders", "blocking"])
	}
	function J() {
		P.webRequest.onHeadersReceived.removeListener(F)
	}
	var V = function(e) {
		return function() {
			return !! P.runtime.lastError && (console.log("[" + e + "] WebExtensions.runtime.lastError => " + P.runtime.lastError.message), !0)
		}
	},
	Y = function() {
		var e = localStorage.option,
		t = {
			counter: 0,
			domain: {}
		};
		try {
			e && Object.assign(t, JSON.parse(e)),
			t.counter = Math.max(0, Math.floor(Number(t.counter) || 0)),
			t.rcounterr = Math.max(0, Math.floor(Number(t.rcounterr) || 0)),
			localStorage.option = JSON.stringify(t)
		} catch(e) {
			console.log(e.stack)
		}
		return t
	},
	K = function(e) {
		localStorage.option = JSON.stringify(e)
	}; (0, A.onMessage)(A.EVENTS.SET_HEADER, (function(e, t) {
		S(e, t)
	})),
	(0, A.onMessage)(A.EVENTS.FETCH_DOM, (function(e, t) {
		w(e, t)
	})),
	(0, A.onMessage)(A.EVENTS.UNSET_HEADER, (function(e, t) {
		J()
	})),
	(0, A.onMessage)(A.EVENTS.KEEP_SET_HEADER, (function(e, t) { !
		function() {
			var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 1e4;
			j && (window.clearTimeout(j), j = window.setTimeout(J, e))
		} (e.keepTime)
	})),
	(0, A.onMessage)(A.EVENTS.BLOCK_ONE_DOMAIN, (function(e, t) {
		T(e)
	})),
	(0, A.onMessage)(A.EVENTS.SET_SPEEDUP_REC, (function(e, t) {
		_(e)
	})),
	(0, A.onMessage)(A.EVENTS.SET_USER_INFO, (function(e, t) {
		x(e)
	})),
	(0, A.onMessage)(A.EVENTS.DLM_NEW_TASK, (function(e, t) {
		var r;
		r = O.PROENV && e.url.startsWith("https://") ? "https": "http";
		var n = 2; (0, O.isActivePro)() && (n = 4),
		startNewDl(e.url, r + (0, O.getDLMUrl)(), n)
	})),
	(0, A.onMessage)(A.EVENTS.ISAP, (function(e, t) {
		t((0, O.isActivePro)())
	})),
	(0, A.onMessage)(A.EVENTS.MESSAGEPIPE, (function(e, t) {
		var r = {
			eventName: A.EVENTS.BROADCASTPIPEMESSAGE,
			data: e
		};
		P.tabs.query({},
		(function(e) {
			for (var t = 0; t < e.length; ++t) P.tabs.sendMessage(e[t].id, r)
		}))
	})),
	(0, A.onMessage)(A.EVENTS.GET_BG_OPTIONS, (function(e, t) {
		t(Y())
	})),
	(0, A.onMessage)(A.EVENTS.SET_BG_OPTIONS, (function(e, t) {
		K(e)
	})),
	fetch(O.HOMEPAGE + "/pub/config/config.json?v=" + Date.now()).then((function(e) {
		return e.json()
	})).then((function(e) {
		if (e.serverNotice && localStorage.setItem("serverNotice", e.serverNotice), e.recltime) {
			var t = Y();
			t.recltime = e.recltime,
			K(t)
		}
		if (e.waittime) {
			var r = Y();
			r.waittime = e.waittime,
			K(r)
		}
		if (e.dailycount) {
			var n = Y();
			n.dailycount = e.dailycount,
			K(n)
		}
	})).
	catch((function(e) {
		console.log("error:", e)
	}))
},
function(e, t) {
	e.exports = function(e) {
		if (Array.isArray(e)) {
			for (var t = 0,
			r = new Array(e.length); t < e.length; t++) r[t] = e[t];
			return r
		}
	}
},
function(e, t) {
	e.exports = function(e) {
		if (Symbol.iterator in Object(e) || "[object Arguments]" === Object.prototype.toString.call(e)) return Array.from(e)
	}
},
function(e, t) {
	e.exports = function() {
		throw new TypeError("Invalid attempt to spread non-iterable instance")
	}
},
function(e, t, r) {
	var n = r(18),
	o = r(19),
	a = r(20);
	e.exports = function(e, t) {
		return n(e) || o(e, t) || a()
	}
},
function(e, t) {
	e.exports = function(e) {
		if (Array.isArray(e)) return e
	}
},
function(e, t) {
	e.exports = function(e, t) {
		if (Symbol.iterator in Object(e) || "[object Arguments]" === Object.prototype.toString.call(e)) {
			var r = [],
			n = !0,
			o = !1,
			a = void 0;
			try {
				for (var i, s = e[Symbol.iterator](); ! (n = (i = s.next()).done) && (r.push(i.value), !t || r.length !== t); n = !0);
			} catch(e) {
				o = !0,
				a = e
			} finally {
				try {
					n || null == s.
					return || s.
					return ()
				} finally {
					if (o) throw a
				}
			}
			return r
		}
	}
},
function(e, t) {
	e.exports = function() {
		throw new TypeError("Invalid attempt to destructure non-iterable instance")
	}
},
function(e, t, r) {
	"use strict";
	var n = r(0)(r(0));
	Object.defineProperty(t, "__esModule", {
		value: !0
	}),
	t.tabs = void 0;
	var o = r(4),
	a = (0, n.
default)(o),
	i = r(5),
	s = (0, n.
default)(i),
	u = r(22),
	c = (0, n.
default)(u),
	l = r(23),
	f = (0, n.
default)(l),
	d = r(9),
	p = (0, n.
default)(d),
	h = r(24); (0, n.
default)(h);
	t.doHlsParsefunction = function() {
		console.log("hlsParser");
		var e = {
			pure: function(e) {
				return e.match(/[^#]+/)[0]
			},
			domain: function(e) {
				return (e.match(/https?:\/\/([^\/]+)/) || [])[1]
			},
			filename: function(e) {
				return ((e.match(/[^\/]+$/) || [])[0] || "").match(/^[^\?&#]*/)[0]
			},
			flatten: function(e) {
				return e.replace(/^https?:/, "").replace(/[^A-Za-z0-9]/g, "X")
			}
		},
		t = function(e, t) {
			var r = !0,
			n = !1,
			o = void 0;
			try {
				for (var a, i = e[Symbol.iterator](); ! (r = (a = i.next()).done); r = !0) {
					var s = a.value;
					if (s.name.toLowerCase() === t) return s.value.toLowerCase()
				}
			} catch(e) {
				n = !0,
				o = e
			} finally {
				try {
					r || null == i.
					return || i.
					return ()
				} finally {
					if (n) throw o
				}
			}
			return ""
		},
		r = function(e) {
			var t = e % 64;
			return "color:#" + ((t >> 4 & 3) << 22 | (t >> 2 & 3) << 14 | (3 & t) << 6 | 1048576).toString(16)
		},
		n = function(e, t, n) {
			return e ? ["tabId %c" + e + "%c [" + t + "]%c " + n, r(e), "color:#f60b91", ""] : ["%c%c[" + t + "]%c " + n, r(e), "color:#f60b91", ""]
		},
		o = function(e) {
			return ["%c" + e, "color:#ff0000"]
		};
		var i, u = localStorage.log,
		l = (localStorage.log, navigator.userAgent.includes("Chrome") ? chrome: browser),
		d = l.runtime.getManifest(),
		h = (l.i18n, (0, m.getLanguage)(), navigator.userAgent.includes("Edge")),
		b = !h && navigator.userAgent.includes("Firefox"),
		E = (!h && navigator.userAgent.includes("Chrome") && Number((navigator.userAgent.match(/Chrome\/(\d+)/) || [])[1] || 0) || 0) < 72 ? ["blocking", "requestHeaders"] : ["blocking", "requestHeaders", "extraHeaders"],
		S = {
			STOPPED: 1,
			RUNNING: 2
		},
		w = {
			NORMAL: 1,
			GREED: 2,
			WATCH: 3,
			CAPTURE: 4,
			TEST: 99
		},
		T = {
			M3U8: 1,
			TS: 2,
			DASH: 3,
			MEDIASTREAM: 4,
			M3U8_CANDIDATE: 99
		},
		_ = {
			SPEED: "speed",
			MEMORY: "memory"
		},
		x = function(e) {
			localStorage.option = JSON.stringify(e)
		},
		O = function(e) {
			return function() {
				if (l.runtime.lastError) {
					var t;
					if (u)(t = console).log.apply(t, (0, p.
				default)(o("[" + e + "] WebExtensions.runtime.lastError => " + l.runtime.lastError.message)));
					return ! 0
				}
				return ! 1
			}
		};
		u && (i = console).log.apply(i, (0, p.
	default)(n(null, d.name, d.version + " start")));
		var I, A = function() {
			var e = localStorage.option,
			t = {
				counter: 0,
				priority: _.SPEED,
				domain: {},
				rcounterr: 0
			};
			try {
				e && Object.assign(t, JSON.parse(e)),
				t.counter = Math.max(0, Math.floor(Number(t.counter) || 0)),
				t.rcounterr = Math.max(0, Math.floor(Number(t.rcounterr) || 0)),
				localStorage.option = JSON.stringify(t)
			} catch(e) {
				var r; (r = console).log.apply(r, (0, p.
			default)(o(e.stack)))
			}
			return t
		} ();
		u && (I = console).log.apply(I, (0, p.
	default)(n(null, "option", JSON.stringify(A))));
		var N = function() {
			function e(t, r) { (0, c.
			default)(this, e);
				var n = r.url,
				o = r.parentTabId,
				a = r.childTabId;
				for (var i in this.id = t,
				this.url = n || "",
				this.parentTabId = o || null,
				this.childTabId = a || null,
				this.ignoreDisconnectOnce = !1,
				this.frames = {},
				this.requestHeaders = {},
				this.que = {},
				T) this.que[T[i]] = [];
				this.actionButtonStatus = "",
				this.stat = S.STOPPED,
				this.mode = w.NORMAL,
				this.storedBlob = {}
			}
			var t, r, i;
			return (0, f.
		default)(e, [{
				key: "push",
				value: function(e, t) {
					var r = this.que[e];
					if (r && !(r.length >= 100)) {
						t.header = function(e) {
							var t = {};
							if (e) {
								var r = !0,
								n = !1,
								o = void 0;
								try {
									for (var a, i = e[Symbol.iterator](); ! (r = (a = i.next()).done); r = !0) {
										var s = a.value;
										t[s.name] = s.value
									}
								} catch(e) {
									n = !0,
									o = e
								} finally {
									try {
										r || null == i.
										return || i.
										return ()
									} finally {
										if (n) throw o
									}
								}
							}
							return t
						} (t.header);
						for (var n = 0,
						o = r.length; n < o; n++) {
							var a = r[n];
							if (a.url === t.url && a.referer === t.referer && JSON.stringify(a.header) === JSON.stringify(t.header)) return
						}
						t.sent = !1,
						r.push(t),
						this.stat === S.RUNNING && this.mode === w.NORMAL && this.consume()
					}
				}
			},
			{
				key: "consume",
				value: (i = (0, s.
			default)(a.
			default.mark((function e(t) {
					var r;
					return a.
				default.wrap((function(e) {
						for (;;) switch (e.prev = e.next) {
						case 0:
							r = this.que[T.M3U8].filter((function(e) {
								return ! e.sent
							})),
							t && 0 === r.length && (r = this.que[T.M3U8_CANDIDATE].filter((function(e) {
								return ! e.sent
							}))),
							this.sendMessage("udpate_index", {
								type: T.M3U8,
								que: r
							}),
							r.forEach((function(e) {
								e.sent = !0
							}));
						case 4:
						case "end":
							return e.stop()
						}
					}), e, this)
				}))),
				function(e) {
					return i.apply(this, arguments)
				})
			},
			{
				key: "start",
				value: (r = (0, s.
			default)(a.
			default.mark((function e(t) {
					var r;
					return a.
				default.wrap((function(e) {
						for (;;) switch (e.prev = e.next) {
						case 0:
							u && (r = console).log.apply(r, (0, p.
						default)(n(this.id, "Tab.start", ""))),
							this.stat = S.RUNNING,
							this.mode = t,
							this.mode === w.NORMAL && this.consume(!0),
							L(this.id);
						case 5:
						case "end":
							return e.stop()
						}
					}), e, this)
				}))),
				function(e) {
					return r.apply(this, arguments)
				})
			},
			{
				key: "stop",
				value: function() {
					var e;
					u && (e = console).log.apply(e, (0, p.
				default)(n(this.id, "Tab.stop", "")));
					this.stat = S.STOPPED
				}
			},
			{
				key: "reset",
				value: function() {
					var e;
					u && (e = console).log.apply(e, (0, p.
				default)(n(this.id, "Tab.reset", "")));
					for (var t in this.stat = S.STOPPED,
					this.mode = w.NORMAL,
					this.ignoreDisconnectOnce = !1,
					this.que) {
						var r = !0,
						o = !1,
						a = void 0;
						try {
							for (var i, s = this.que[t][Symbol.iterator](); ! (r = (i = s.next()).done); r = !0) {
								i.value.sent = !1
							}
						} catch(e) {
							o = !0,
							a = e
						} finally {
							try {
								r || null == s.
								return || s.
								return ()
							} finally {
								if (o) throw a
							}
						}
					}
					L(this.id)
				}
			},
			{
				key: "destroy",
				value: function() {
					var e;
					u && (e = console).log.apply(e, (0, p.
				default)(n(this.id, "Tab.destroy", "")));
					this.stop(),
					delete y[this.id];
					var t = Object.assign({},
					this.storedBlob);
					setTimeout((function() {
						for (var e in t) URL.revokeObjectURL(e)
					}), 3e3)
				}
			},
			{
				key: "revokeObjectURL",
				value: function(e) {
					if (e) {
						var t = !0,
						r = !1,
						n = void 0;
						try {
							for (var o, a = e[Symbol.iterator](); ! (t = (o = a.next()).done); t = !0) {
								var i = o.value;
								URL.revokeObjectURL(i),
								delete this.storedBlob[i]
							}
						} catch(e) {
							r = !0,
							n = e
						} finally {
							try {
								t || null == a.
								return || a.
								return ()
							} finally {
								if (r) throw n
							}
						}
					}
				}
			},
			{
				key: "sendMessage",
				value: function(e, t) {
					var r, a = this;
					u && (r = console).log.apply(r, (0, p.
				default)(n(this.id, "sendMessage", e)));
					return new Promise((function(r, n) {
						a.childTabId && a.stat === S.RUNNING ? l.tabs.sendMessage(a.childTabId, {
							cmd: e,
							params: t
						},
						(function(e) {
							var t;
							l.runtime.lastError && (t = console).log.apply(t, (0, p.
						default)(o("[Tab.sendMessage] WebExtensions.runtime.lastError => " + l.runtime.lastError.message)));
							r(e)
						})) : r()
					}))
				}
			},
			{
				key: "virtualize",
				value: function() {
					var e = "" + this.id;
					if (this.childTabId && y[this.childTabId] && !e.startsWith("virtual_")) {
						var t;
						if (delete y[e], this.id = "virtual_for_" + this.childTabId, y[this.id] = this, y[this.childTabId].parentTabId = this.id, this.mode === w.CAPTURE && l.tabs.sendMessage(this.childTabId, {
							cmd: "intercept_ondata",
							params: {
								url: "disconnect"
							}
						},
						O("tabs.sendMessage.2x")), u)(t = console).log.apply(t, (0, p.
					default)(n(e, "tab.virtualize", "to " + this.id)));
						return ! 0
					}
					return ! 1
				}
			},
			{
				key: "isLoader",
				get: function() {
					return this.parentTabId
				}
			}], [{
				key: "create",
				value: function(t, r) {
					if (t) {
						var o, a;
						if (y[t]) {
							if (u)(o = console).log.apply(o, (0, p.
						default)(n(t, "Tab.create", y[t].url + " [ EXISTS ] , ignore")))
						} else if (y[t] = new e(t, r), u)(a = console).log.apply(a, (0, p.
					default)(n(t, "Tab.create", y[t].url)));
						L(t)
					} else {
						var i;
						if (u)(i = console).log.apply(i, (0, p.
					default)(n(t, "Tab.create", "No tabID is specified, abort.")))
					}
				}
			},
			{
				key: "remove",
				value: (t = (0, s.
			default)(a.
			default.mark((function e(t) {
					var r, o, i, s;
					return a.
				default.wrap((function(e) {
						for (;;) switch (e.prev = e.next) {
						case 0:
							r = y[t],
							o = r.isLoader,
							r && (o ? (r.stop(), delete y[t], (i = y[r.parentTabId]) && (i.stop(), i.reset(), i.childTabId = null, (i.id + "").startsWith("virtual_") && i.destroy())) : r.mode === w.NORMAL ? r.destroy() : r.mode === w.CAPTURE && (r.destroy(), l.tabs.sendMessage(r.childTabId, {
								cmd: "intercept_ondata",
								params: {
									url: "disconnect"
								}
							},
							O("tabs.sendMessage.2xx"))), u && (s = console).log.apply(s, (0, p.
						default)(n(t, "Tab.remove", r.url))));
						case 3:
						case "end":
							return e.stop()
						}
					}), e)
				}))),
				function(e) {
					return t.apply(this, arguments)
				})
			},
			{
				key: "find",
				value: function(t, r) {
					if (r === e.TAB_ID) return y[t];
					var n = ["id", "parentTabId", "childTabId"][r];
					for (var o in y) {
						var a = y[o];
						if (a[n] === t) return a
					}
					return null
				}
			}]),
			e
		} ();
		function D(e, t) {
			var r;
			u && (r = console).log.apply(r, (0, p.
		default)(n(e.id, "browserAction.onClicked", "")));
			var o = e.id,
			a = e.index,
			i = y[o];
			if (i) {
				var s, c = i.url;
				if (!c.startsWith("http")) return t({
					msg: (0, m.t)("TbgTryLater")
				});
				if (i.isLoader) return t({
					msg: (0, m.t)("TbgIsDownloading")
				});
				if (m.DISABLE_DOWNLOADING_FROM_YOUTUBE_REGEXP.exec(c)) return t({
					msg: "Do not support this webpage"
				});
				i.childTabId ? l.tabs.update(i.childTabId, {
					active: !0
				},
				O("tabs.update.1")) : (s = m.PROENV && c.startsWith("https://") ? "https": "http", v = (0, m.getLoaderUrl)(), l.tabs.create({
					url: s + v,
					index: a + 1,
					active: !0
				},
				(function(e) {
					if (!O("tabs.create")()) {
						var t, r = e.url || e.pendingUrl;
						if (b && (r = s + v), u)(t = console).log.apply(t, (0, p.
					default)(n(e.id, "browserAction.onClicked->tabs.create", "new loader tab " + r)));
						N.create(e.id, {
							url: r,
							parentTabId: o
						}),
						i.childTabId = e.id,
						A.counter++,
						x(A),
						(0, g.plusDlCount)()
					}
				})))
			}
		}
		Object.assign(N, {
			TAB_ID: 0,
			PARENT_ID: 1,
			CHILD_ID: 2
		}),
		l.webRequest.onBeforeRequest.addListener((function(t) {
			var r = t.tabId,
			o = e.pure(t.url),
			a = y[r];
			if (a && (a.actionButtonStatus = "", a.url === o && !a.isLoader)) if (a.ignoreDisconnectOnce) {
				var i;
				if (u)(i = console).log.apply(i, (0, p.
			default)(n(r, "onBeforeRequest", "ignore reloading for intercept-loader")));
				a.ignoreDisconnectOnce = !1
			} else if (a.childTabId) {
				var s;
				if (u)(s = console).log.apply(s, (0, p.
			default)(n(r, "onBeforeRequest", "reload, " + t.url)));
				a.virtualize() || N.remove(r),
				N.create(r, {
					url: o
				})
			} else {
				var c;
				if (u)(c = console).log.apply(c, (0, p.
			default)(n(r, "onBeforeRequest", "ignore reloading ( has no child ), " + t.url)))
			}
		}), {
			urls: ["<all_urls>"],
			types: ["main_frame"]
		},
		[]),
		l.webRequest.onBeforeSendHeaders.addListener((function(e) {
			var t = e.requestHeaders,
			r = e.url,
			n = e.tabId,
			o = e.type,
			a = e.requestId,
			i = y[n];
			if (i && !m.DISABLE_DOWNLOADING_FROM_YOUTUBE_REGEXP.exec(r)) return i.isLoader ? A.counter < 30 && r.includes("pagead2") ? {
				cancel: !0
			}: "xmlhttprequest" === o && r.includes("cococut_promotion") ? {
				cancel: !0
			}: void 0 : (i && "xmlhttprequest" === o && (i.requestHeaders[a] = t), {
				requestHeaders: t
			})
		}), {
			urls: ["<all_urls>"]
		},
		E),
		l.webRequest.onBeforeSendHeaders.addListener((function(e) {
			var t = e.requestHeaders,
			r = (e.url, e.tabId, e.type);
			e.requestId;
			if ("xmlhttprequest" === r) for (var n = 0,
			o = t.length; n < o; n++) {
				var a = t[n];
				a.name.startsWith("LM_") && (t[n] = {
					name: a.name.substr(3),
					value: a.value
				})
			}
			return {
				requestHeaders: t
			}
		}), {
			urls: ["<all_urls>"]
		},
		E),
		l.webRequest.onHeadersReceived.addListener((function(r) {
			var o = r.url,
			a = r.tabId,
			i = r.type,
			s = r.frameId,
			c = r.statusCode,
			l = r.responseHeaders,
			f = r.requestId,
			d = r.method,
			h = c >= 200 && c < 300,
			v = y[a];
			if (v && "OPTIONS" !== d) {
				if (h && !v.isLoader && !m.DISABLE_DOWNLOADING_FROM_YOUTUBE_REGEXP.exec(o)) {
					v.frames[s] || (v.frames[s] = r.url);
					var g = e.filename(o),
					b = t(l, "content-type");
					if (b.match(/(mpegurl|m3u)/) || g.match(/(\.m3u8)/)) {
						var E;
						if (u)(E = console).log.apply(E, (0, p.
					default)(n(a, "Found : " + b + ", " + r.type, o)));
						var S = 0 !== s ? v.frames[s] : v.url,
						w = v.requestHeaders[f];
						v.push(T.M3U8, {
							url: o,
							contentType: b,
							referer: S,
							header: w
						}),
						L(a)
					} else {
						if ("xmlhttprequest" === i && o.match(/[\.\/](m3u|hls)/)) if (!g.match(/\.(js|json|html)$/)) if (0 === v.que[T.M3U8].length) if (Number(t(l, "content-length")) < 1048576) {
							var _ = v.requestHeaders[f],
							x = 0 !== s ? v.frames[s] : v.url;
							v.push(T.M3U8_CANDIDATE, {
								url: o,
								contentType: "application/x-mpegURL",
								referer: x,
								header: _
							}),
							L(a)
						}
					}
				}
				delete v.requestHeaders[f]
			}
		}), {
			urls: ["<all_urls>"]
		},
		["responseHeaders", "blocking"]),
		l.tabs.onUpdated.addListener((function(t, r, o) {
			if (O("tabs.onUpdated"), "loading" === r.status) {
				var a = e.pure(o.url),
				i = y[t];
				if (i) {
					if (i.isLoader) if (a.includes(v) || b) {
						var s;
						if (u)(s = console).log.apply(s, (0, p.
					default)(n(t, "tabs.onUpdated", "LoaderTab [ reloading ] , ignore")));
						var c = y[i.parentTabId];
						c && (c.stop(), c.reset())
					} else {
						var l;
						if (u)(l = console).log.apply(l, (0, p.
					default)(n(t, "tabs.onUpdated", a + " [ moved ]")));
						N.remove(t),
						N.create(t, {
							url: a
						})
					} else if (i.url === a);
					else {
						var f;
						if (u)(f = console).log.apply(f, (0, p.
					default)(n(t, "tabs.onUpdated", a + " [ moved ]")));
						i.virtualize() || N.remove(t),
						N.create(t, {
							url: a
						})
					}
					L(t)
				} else {
					var d;
					if (u)(d = console).log.apply(d, (0, p.
				default)(n(t, "onBeforeRequest", a + " [ new ]")));
					N.create(t, {
						url: a
					})
				}
			}
		})),
		l.tabs.onRemoved.addListener((function(e) {
			var t, r = y[e];
			u && (t = console).log.apply(t, (0, p.
		default)(n(e, "tabs.onRemoved", (null == r ? void 0 : r.url) || "none")));
			r && (r.virtualize() || N.remove(e))
		})),
		l.runtime.onMessage.addListener((function(e, t, r) {
			var o, a, i = e.cmd,
			s = e.params,
			c = e.msgSender,
			f = null === (o = t.tab) || void 0 === o ? void 0 : o.id;
			if ("cmd_open_parser" == i && l.tabs.query({
				active: !0,
				lastFocusedWindow: !0
			},
			(function(e) {
				D(e[0], r)
			})), "intercept_ondata" === i) {
				if (y[f]) {
					var h = s.targetId,
					v = y[h];
					v && v.parentTabId === f && l.tabs.sendMessage(h, {
						cmd: i,
						params: s
					},
					O("tabs.sendMessage.2"))
				}
				return r()
			}
			u && ("fetch" !== i && (a = console).log.apply(a, (0, p.
		default)(n(f, "onMessage", JSON.stringify(e).substr(0, 100)))));
			var g = N.find(f, N.CHILD_ID);
			if (!g && c && "cocoParser" == c) return console.log("no tab"),
			r({
				error: "no related tabs found"
			});
			if ("init" === i) {
				var m = f,
				b = g.id,
				E = s.counter || 0,
				S = (null == d ? void 0 : d.version) || "0.0.0";
				A.counter < E && (A.counter = E, x(A));
				var T = A.counter;
				return g.title ? r({
					id: m,
					parentTabId: b,
					url: g.url,
					title: g.title,
					counter: T,
					version: S
				}) : ("" + g.id).startsWith("virtual_") ? r({
					id: m,
					parentTabId: b,
					url: g.url,
					title: "video title - none",
					counter: T
				}) : (l.tabs.get(g.id, (function(e) {
					return g.title = e.title,
					r({
						id: m,
						parentTabId: b,
						url: g.url,
						title: g.title,
						counter: T,
						version: S
					})
				})), !0)
			}
			if ("start_normal" === i) return g.start(w.NORMAL),
			r();
			if ("fetch" === i) {
				var _ = s.url,
				I = s.method,
				L = s.headers,
				P = (s.timeout, s.revokeList);
				return g.revokeObjectURL(P),
				fetch(_, {
					method: I || "GET",
					mode: "cors",
					credentials: "include",
					headers: L
				}).then((function(e) {
					if (e.ok) return e.blob();
					r({
						ok: !1,
						message: "fetch error, may be 403 or 429"
					})
				})).then((function(e) {
					var t = URL.createObjectURL(e);
					g.storedBlob[t] = 1,
					r({
						ok: !0,
						blobUrl: t
					})
				})).
				catch((function(e) {
					r({
						ok: !1,
						message: e.messsage
					})
				})),
				!0
			}
			if ("intercept_request" === i) {
				if (g && !("" + g.id).startsWith("virtual_")) {
					g.ignoreDisconnectOnce = !0,
					setTimeout((function() {
						delete g.ignoreDisconnectOnce
					}), 3e3),
					l.tabs.update(g.id, {
						active: !0
					},
					O("tabs.update.at.CMD_INTERCEPT_REQUEST"));
					var M = "localStorage._intercept_mediastream_=" + f + ";location.reload();";
					return l.tabs.executeScript(g.id, {
						code: M,
						allFrames: !0
					},
					O("tabs.executeScript.on.CMD_INTERCEPT_REQUEST")),
					g.start(w.CAPTURE),
					A.rcounterr++,
					x(A),
					r(!0)
				}
				return r(!1)
			}
			if ("intercept_ok" === i) {
				delete g.ignoreDisconnectOnce;
				l.tabs.executeScript(g.id, {
					code: "delete localStorage._intercept_mediastream_;",
					allFrames: !0
				},
				O("tabs.executeScript.on.CMD_INTERCEPT_OK"))
			}
			c && "cocoParser" == c && r()
		})),
		l.commands.onCommand.addListener((function(e) {
			var t = function() {};
			"force-download" === e && ((0, m.isActivePro)() ? l.tabs.query({
				active: !0,
				lastFocusedWindow: !0
			},
			(function(e) {
				D(e[0], t)
			})) : l.tabs.create({
				url: m.HOMEPAGE + "/needpro.html",
				active: !0
			}))
		}));
		var L = function(e) {
			if (! (e + "").startsWith("virtual")) {
				var t = y[e],
				r = !t || t.isLoader ? "loader": t.mode === w.CAPTURE ? "capturing": t.que[T.M3U8].length ? "enable": t.que[T.M3U8_CANDIDATE].length ? "enable_weak": "off";
				if (r !== t.actionButtonStatus) {
					var o;
					if (u)(o = console).log.apply(o, (0, p.
				default)(n(e, "updatePageActionButton", r)));
					t.actionButtonStatus = r
				}
			}
		}
	};
	var v, g = r(1),
	m = r(3),
	y = t.tabs = {}
},
function(e, t) {
	e.exports = function(e, t) {
		if (! (e instanceof t)) throw new TypeError("Cannot call a class as a function")
	}
},
function(e, t) {
	function r(e, t) {
		for (var r = 0; r < t.length; r++) {
			var n = t[r];
			n.enumerable = n.enumerable || !1,
			n.configurable = !0,
			"value" in n && (n.writable = !0),
			Object.defineProperty(e, n.key, n)
		}
	}
	e.exports = function(e, t, n) {
		return t && r(e.prototype, t),
		n && r(e, n),
		e
	}
},
function(e, t) {
	function r(e) {
		return (r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ?
		function(e) {
			return typeof e
		}: function(e) {
			return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol": typeof e
		})(e)
	}
	function n(t) {
		return "function" == typeof Symbol && "symbol" === r(Symbol.iterator) ? e.exports = n = function(e) {
			return r(e)
		}: e.exports = n = function(e) {
			return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol": r(e)
		},
		n(t)
	}
	e.exports = n
}]);